package modelLayer;
import java.util.ArrayList;

/**
 * OwnerContainer class that manages the ArrayList with owner objects
 * @author Thomas Bonderup
 * @version 1.0.0
 */
public class OwnerContainer {

	// instance variables
	private static OwnerContainer instance;
	private ArrayList<Owner> ownerList;
	
	/**
	 * Constructor for the class OwnerContainer
	 */
	public OwnerContainer() {
		ownerList = new ArrayList<Owner>();
	}
	/**
	 * Singleton
	 * @return instance
	 */
	public static OwnerContainer getInstance() {
		if(instance == null) {
			instance = new OwnerContainer();
		}
		return instance;
	}
	/**
	 * Returns the objects of the ArrayList
	 * @return ownerList
	 */
	public ArrayList<Owner> owners() {
		return ownerList;
	}
	/**
	 * Adds owner object to the ArrayList
	 * @param owner
	 */
	public void addOwner(Owner owner) {
		ownerList.add(owner);
	}
	/**
	 * Returns forest object
	 * @param index
	 * @return
	 */
	public Owner getOwner(int index) {
		return ownerList.get(index);
	}
}
